package com.nut.lmsc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nut.lmsc.entity.GoodsSpec;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GoodsSpecMapper extends BaseMapper<GoodsSpec> {

    @Select("select * from biz_goods_spec where goods_id=#{goodsId} and deleted=0")
    List<GoodsSpec> selectByGoodsId(@Param("goodsId") Integer goodsId);

    @Select("select * from biz_goods_spec where goods_id=#{goodsId} and spec=#{spec} and deleted=0")
    GoodsSpec selectByGoodsIdSpec(@Param("goodsId") Integer goodsId, @Param("spec") String spec);

}